package com.ll.exceptiondemo;

/**
 * @author 刘龙
 * @version 1.0
 */
public class ClassCastExceptionDemo {
    public static void main(String[] args) {
        // 向上转型
        A a = new B();

        // 向下转型
        B b = (B)a;

        // ClassCastException
        C c = (C)a;
    }
}

class A { }

class B extends A{}

class C extends A{}
